package com.syh.jn.scm.infrastructure.repository.model.finance;

import com.syh.core.ddd.infrastructure.repository.model.SuperBusinessModel;
import lombok.*;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.math.BigDecimal;

/**
 * 对账单
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
@Entity
@Table(name = "T_FINANCE_STATEMENT_ACCOUNT_BILL")
@EqualsAndHashCode(callSuper = true)
public class StatementAccountBillModel extends SuperBusinessModel {
  /**
   * 对账单编号
   */
  @Column(name = "CODE", columnDefinition = "varchar(50) COMMENT '收款单编号'")
  private String code;
  /**
   * 收状态:0未收款, 1 部分收款 2 完成收款
   */
  @Column(name = "STATE", columnDefinition = "smallint COMMENT '收状态:0未收款, 1 部分收款 2 完成收款'")
  private Short state;
  /**
   * 客户类型: 0上游, 1下游, 2物流
   */
  @Column(name = "CUSTOMER_TYPE", columnDefinition = "smallint COMMENT '客户类型: 0上游, 1下游, 2物流'")
  private Short customerType;
  /**
   * 客户id
   */
  @Column(name = "CUSTOMER_ID", columnDefinition = "bigint COMMENT '客户id'")
  private Long customerId;
  /**
   * 录单人id
   */
  @Column(name = "BROKERAGE_ID", columnDefinition = "bigint COMMENT '录单人id'")
  private Long brokerageId;
  /**
   * 对账金额
   */
  @Column(name = "PRICE", columnDefinition = "decimal(19,2) COMMENT '对账金额'")
  private BigDecimal price;
  /**
   * 已收款金额
   */
  @Column(name = "MAKE_COLLECTIONS_PRICE", columnDefinition = "decimal(19,2) COMMENT '已收款金额'")
  private BigDecimal makeCollectionsPrice;
  /**
   * 已生成收付款单金额
   */
  @Column(name = "GENERATED_COLLECTIONS_PRICE", columnDefinition = "decimal(19,2) COMMENT '已生成收付款单金额'")
  private BigDecimal generatedCollectionsPrice;
  /**
   * 生成日期
   */
  @Column(name = "INPUT_TIMESTAMP", columnDefinition = ("bigint COMMENT '生成日期'"))
  private Long inputTimestamp;
  /**
   * 业务确认状态:0双方都未确认,1只有服务商确认,2只有上游或下游确认,3代表双方都确认
   */
  @Column(name = "BUSINESS_STATE", columnDefinition = "smallint COMMENT '业务确认状态:0双方都未确认,1只有服务商确认,2只有上游或下游确认,3代表双方都确认'")
  private Short businessState;
  /**
   * 财务确认状态:0双方都未确认,1只有服务商确认,2只有上游或下游确认,3代表双方都确认
   */
  @Column(name = "FINANCE_STATE", columnDefinition = "smallint COMMENT '财务确认状态:0双方都未确认,1只有服务商确认,2只有上游或下游确认,3代表双方都确认'")
  private Short financeState;
  /**
   * 开票状态:0未开票, 1已开票
   */
  @Column(name = "TICKET_STATE", columnDefinition = "smallint COMMENT '开票状态:0未开票,1部分开票， 2已完成票'")
  private Short ticketState;
  /**
   * 开票金额
   */
  @Column(name = "TICKET_PRICE", columnDefinition = "decimal(19,2) COMMENT '开票金额'")
  private BigDecimal ticketPrice;
  /**
   * 已生成开票金额
   */
  @Column(name = "GENERATED_TICKET_PRICE", columnDefinition = "decimal(19,2) COMMENT '已生成开票金额'")
  private BigDecimal generatedTicketPrice;
  /**
   * 我方单据图片
   */
  @Column(name = "MAIN_SRC_IMAGES", columnDefinition = "varchar(1000) COMMENT '我方单据图片'")
  private String mainSrcImages;
  /**
   * 上游或下游单据图片
   */
  @Column(name = "SECOND_SRC_IMAGES", columnDefinition = "varchar(1000) COMMENT '上游或下游单据图片'")
  private String secondSrcImages;
  /**
   * 创建日期
   */
  @Column(name = "CREATE_TIME_STAMP", columnDefinition = "bigint COMMENT '创建日期'")
  private Long createTimeStamp;
  /**
   * 最后修改日期
   */
  @Column(name = "LAST_UPDATE_TIME_STAMP", columnDefinition = "bigint COMMENT '最后修改日期'")
  private Long lastUpdateTimeStamp;
}
